<template>
  <div class="search-view">
    <!-- 搜索容器 -->
    <div class="search-bar">
      <span class="glass">🔍</span>
      <input type="text" />
      <span class="close">❌</span>
    </div>
    <!-- 搜索时显示 -->
    <div v-if="true" class="search-box">
      <!-- 热门搜索 -->
      <div class="hot-box">
        <h4 class="title">热门搜索</h4>
        <ul class="content">
          <li v-for="item in 10" :key="item" class="item">孤勇者</li>
        </ul>
      </div>
      <!-- 搜索历史 -->
      <ul class="history-items">
        <li class="item" v-for="item in 10" :key="item">
          <span>⏰</span>
          <div class="content">
            <div class="label">再见莫妮卡</div>
            <span class="close">❌</span>
          </div>
        </li>
      </ul>
    </div>
    <!-- 搜索结果 -->
    <div v-if="false" class="content">
      <div v-for="item in 10" :key="item" class="cell">
        <div class="left">
          <h3>终有一散的人们</h3>
          <p>周震男 - You jump,I jump</p>
        </div>
        <span>▶️</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'SearchView'
}
</script>

<style lang="less" scoped>
.search-view {
  .search-bar {
    position: relative;
    padding: 10px;
    border-bottom: 1px solid #eeeff0;
    span {
      position: absolute;
    }
    .glass {
      top: 15px;
      left: 20px;
    }
    .close {
      right: 20px;
      top: 13px;
      padding: 2px;
    }
    input {
      background-color: #ebecec;
      border: none;
      height: 30px;
      border-radius: 15px;
      display: block;
      width: calc(100% - 10px);
      margin: 0 auto;
      padding-left: 25px;
      appearance: none;
      outline: none;
    }
  }
  .hot-box {
    padding: 15px;
    .title {
      font-size: 14px;
      color: #666666;
      font-weight: normal;
      padding-bottom: 15px;
    }
    .content {
      display: flex;
      flex-wrap: wrap;
      li {
        margin-right: 10px;
        margin-bottom: 10px;
        padding: 10px;
        border: 1px solid #ededf1;
        border-radius: 20px;
        font-size: 15px;
      }
    }
  }
  .history-items {
    .item {
      display: flex;
      align-items: center;
      height: 45px;
      span {
        padding: 0 10px;
        font-size: 20px;
        opacity: 0.5;
      }
      .content {
        flex: 1;
        display: flex;
        justify-content: space-between;
        border-bottom: 1px solid #eeeff0;
        height: 100%;
        align-items: center;
        .close {
          opacity: 0.5;
        }
      }
    }
  }
  .content {
    padding: 0 3px;
    .cell {
      padding: 5px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid #efeff0;
      .left {
        flex: 1;
        h3 {
          font-weight: normal;
          font-size: 18px;
        }
        p {
          margin-top: 4px;
          font-size: 14px;
          color: #888888;
        }
      }
      span {
        font-size: 20px;
      }
    }
  }
}
</style>
